package org.xteam.sled.matcher;

import java.util.ArrayList;
import java.util.List;

import org.xteam.sled.semantic.SemanticContext;

public class Matcher {
	
	private String pc; // was a list
	private String successor;
	private List<ArmBuilder> arms = new ArrayList<ArmBuilder>();
	private ArmBuilder elseArm;
	
	public void elaborate(SemanticContext ctxt) {
		int uid = 0;
		for (ArmBuilder arm : arms) {
			arm.elaborate(ctxt, uid++, successor);
		}
		if (elseArm != null) {
			/* ARM (Absolute.epsilon,
  			       { original = originalElse, answers = StringMap.empty,
  				 name = NONE, code = elsearm, patRegion = rgn elsearm, 
  			         conditions = Absolute.Exp.Set.empty,
  			         patlen = optmap (fn _ => 0) succptr })] */

			elseArm.elaborate(ctxt, uid, successor);
		}
	}
	
}
